/*
 * rng_example.c: Implement an example for the libsharp rng.
 * We'll only use the internal RNG here.
 */
#include <sharp-rng.h>
#include <stdio.h>
#include <stdlib.h>

int main(void) {
    int a, r;
    float b;
    char c[15];

    /* First of all, initialize the internal RNG. This actually reads
     * /dev/urandom and sets the internal RNG up. Mandatory to call.
     */
    sharp_rng_init();

    /* Let's grab some output, shall we? */
    a = sharp_rng_get_int();
    b = sharp_rng_get_float();
    sharp_rng_get_string(c, 14);
    c[14] = '\0';
    r = sharp_rng_get_range(1, 4);

    /* And output. */
    printf("a: %d\n", a);
    printf("b: %f\n", b);
    printf("c: %s\n", c);
    printf("r: %d\n", r);

    return EXIT_SUCCESS;
}

